package com.yxqz.xfz.rabbitmq.mq;

import com.rabbitmq.client.Channel;
import com.yxqz.xfz.rabbitmq.config.RabbitmqConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author 鱼香茄子
 * @data 2021/10/26
 * 接收消息处理
 */

@Component
public class ReceiveHandler {


    /**
     *
     * @param msg 传递的消息
     * @param message org.springframework.amqp.core.Message;
     * @param channel com.rabbitmq.client.Channel;
     *  RabbitListener 自动监听 springboot管理的
     */
    @RabbitListener(queues = {RabbitmqConfig.QUEUE_INFORM_EMAIL})
    public  void  send_email(String msg, Message message, Channel channel){

        System.out.println("接收到的消息是："+msg);
    }

}
